Non Patent Literatures (NPLs) 1 and 2 each disclose an image encoding technique that uses context-based adaptive binary arithmetic coding (CABAC).
FIG. 14 is a block diagram showing a structure of an image quantization parameter encoding device in the image encoding technique that uses CABAC. The image quantization parameter encoder shown in FIG. 14 (hereafter referred to as the typical image quantization parameter encoder) includes a predictor 101, a buffer 102, a binarizer 1030, an adaptive binary arithmetic encoder 104, and a switch (SW) 111.
A predicted quantization parameter (predicted QP: PQP) supplied from the predictor 101 is subtracted from a quantization parameter (QP) input to the typical image quantization parameter encoder. The QP from which the PQP has been subtracted is referred to as a delta quantization parameter (delta QP: DQP).
In NPL 1, the PQP is a reconstructed quantization parameter (last reconstructed QP: LastRQP) of a last reconstructed image block. In NPL 2, the PQP is a reconstructed quantization parameter (left reconstructed QP: LeftRQP) of a left adjacent image block or a reconstructed quantization parameter (LastRQP) of a last reconstructed image block.
The PQP is added to the DQP and the sum is stored in the buffer 102 as a reconstructed quantization parameter (reconstructed QP: RQP), for subsequent quantization parameter encoding.
The binarizer 1030 binarizes the DQP to obtain a bin string. One bit of the bin string is referred to as a bin. In the bin string, a bin that is binary arithmetic encoded first is referred to as the first bin (1st bin), a bin that is binary arithmetic encoded second is referred to as the second bin (2nd bin), and a bin that is binary arithmetic encoded nth is referred to as the nth bin (nth bin). The bin and the bin string are defined in 3.9 and 3.12 in NPL 1.
FIG. 15 is an explanatory diagram showing a correspondence table between the DQP (rightmost column) and the bin string (center column) in NPLs 1 and 2.
A bin string index in the leftmost column in FIG. 15 indicates an index of a bin string corresponding to a DQP value. The bin string index is 1 in the case where the DQP is 0, 2*DQP−1 in the case where the DQP is greater than 0, and −2*DQP+1 in the case where the DQP is less than 0 (where “*” denotes multiplication).
A context index in the lowermost row in FIG. 15 indicates an index of a context used for binary arithmetic encoding of a bin in a corresponding column. For example, the bin string corresponding to DQP=−1 is 110 in which the value of the first bin is 1, the value of the second bin is 1, and the value of the third bin is 0. The context index used for binary arithmetic encoding of the first bin is 0, the context index used for binary arithmetic encoding of the second bin is 2, and the context index used for binary arithmetic encoding of the third bin is 3. The context mentioned here is a combination of a most probable symbol (PS) of the bin and its probability.
The adaptive binary arithmetic encoder 104 binary arithmetic encodes each bin of the bin string supplied via the switch 111 beginning with the first bin, using the context associated with the corresponding context index. The adaptive binary arithmetic encoder 104 also updates the context associated with the context index according to the value of the binary arithmetic encoded bin, for subsequent binary arithmetic encoding. Detailed operations of adaptive binary arithmetic encoding are described in 9.3.4 in NPL 1.
The typical quantization parameter encoder encodes the input image quantization parameter based on the above-mentioned operations.